<template>
    <div>
        <!-- 左侧导航栏 -->
        <el-row>
            <el-col :span="4" class="left-nav">
                <el-menu
                        :default-active="dfActive"
                        class="el-menu-vertical-demo">
                    <el-submenu index="1">
                        <template slot="title">
                            <img src="../../assets/imgs/menu_icon_jigou_default.png" alt="">&nbsp;
                            <span>分销机构管理</span>
                        </template>
                        <el-menu-item-group>
                            <el-menu-item index="1-1" @click="jumpTo(1)">分销授权</el-menu-item>
                            <el-menu-item index="1-2" @click="jumpTo(2)">机构管理</el-menu-item>
                        </el-menu-item-group>
                    </el-submenu>
                </el-menu>
            </el-col>

            <!-- 路由 -->
            <el-col :span="20" class="router-container">
                <router-view @sendActive="getActive" ></router-view>
            </el-col>
        </el-row>
    </div>
</template>

<script>
    export default {
        data: function () {
            return {
                dfActive:"1-1"
            }
        },
        methods: {
            jumpTo(i){
                switch(i){
                    case 1:this.$router.push("/index/saleManage/fenxiaoimpower");break;
                    case 2:this.$router.push("/index/saleManage/jigoumanagement");break;
                }
            },
            getActive(val){
                this.dfActive=val;
                console.log(this.dfActive)
            }
        },
        computed: {},
        watch: {},
        mounted() {
            this.$emit("sendTag", 10);
        }
    };
</script>
<style scoped>
</style>